package agentspeakeditor.editors;

import org.eclipse.jface.text.rules.*;

import agentspeakeditor.editors.highlight.BeliefRule;

public class ASLPartitionScanner extends RuleBasedPartitionScanner {
	public final static String ASL_COMMENT = "__asl_comment";
	public final static String ASL_PLAN = "__asl_plan";
	public final static String ASL_DESIRE = "__asl_desire";
	public final static String ASL_BELIEF = "__asl_belief";
	public final static String ASL_CONTEXT = "__asl_context";

	
	public ASLPartitionScanner() {

		IToken aslComment = new Token(ASL_COMMENT);
		IToken aslPlan = new Token(ASL_PLAN);
		IToken aslDesire = new Token(ASL_DESIRE);
		IToken aslBelief = new Token(ASL_BELIEF);

		IPredicateRule[] rules = new IPredicateRule[6];

		rules[0] = new EndOfLineRule("//", aslComment);
		rules[1] = new MultiLineRule("/*", "*/", aslComment);
		rules[2] = new SingleLineRule("!", ".", aslDesire);
		rules[3] = new MultiLineRule("+", ".\r\n", aslPlan);	
		rules[4] = new MultiLineRule("-", ".\r\n", aslPlan);
		rules[5] = new BeliefRule(aslBelief);
		
		setPredicateRules(rules);
	}
}
